package day7;

import org.junit.Test;

public class Demo {
	@Test
	public void test55() {
		// invisible
		// The constructor ArrayUtil() is not visible
		// ArrayUtil arrayUtil = new ArrayUtil();
		ArrayUtil.max(new int[3]);
	}

	public static void main(String[] args) {
		Student student = new Student();
		student.id = 23;
		student.name = "张三";
		student.show();
		
		// 访问静态属性、静态方法有两种方式
		// The static field Student.country should be accessed in a static way
		// 对象.静态属性   对象.静态方法：让别人容易产生歧义，以为这个属性和方法是实例属性，实例方法
		student.country = "中国";
		System.out.println(student.country);
		// static way: 类名.属性
		Student.country = "中";
		System.out.println(Student.country);
		
		int max1 = student.getMax(3, 2);
		System.out.println(max1);
		int max2 = Student.getMax(3, 2);
		System.out.println(max2);
	}
	
	@Test
	public void test4() {
		// 一个类可以创建多个对象：同一个类的不同对象，
		// 结构相同，数据不同。
		Student student1 = new Student();
		student1.id = 1;
		student1.name = "zhangsan";
		
		Student student2 = new Student();
		student2.id = 2;
		student2.name = "lisi";
		
		student1.country = "中国";
		
		System.out.println(student1.country);// 中国
		System.out.println(student2.country);// 中国
		System.out.println(Student.country);// 中国
		
	}
	
	
	@Test
	public void test66() {
		// 静态的属性和静态的方法是属于这个类的，相当于公共的，可以被new出来的对象访问
		int max = Student.getMax(3, 5);
		System.out.println(max);
		
		Math.max(3, 2);
		
		int[] array = {23, 5, 63, 8};
		int max1 = ArrayUtil.max(array);
		System.out.println(max1);
	}
	
	@Test
	public void test6() {
		Teacher teacher1 = new Teacher();
		Teacher teacher2 = new Teacher();
		
	}
	
	
	
	
	
	
	
}
